package com.ynet.hm.utils.exception;

import com.ynet.hm.utils.enums.ExceptionEnum;

/**
 * 
 * Title: MyException.java<br/>
 * Description:自定义异常 <br/> 	
 * @author chengcaiyi 
 * @version 1.0  
 * @date 2018年6月21日
 */
public class MyException extends RuntimeException {

	private static final long serialVersionUID = 2333255239135283561L;

	private String code;

	/**
	 * 继承exception，加入错误状态值
	 * 
	 * @param exceptionEnum
	 */
	public MyException(ExceptionEnum exceptionEnum) {
		super(exceptionEnum.getMsg());
		this.code = exceptionEnum.getCode();
	}

	/**
	 * 自定义错误信息
	 * 
	 * @param message
	 * @param code
	 */
	public MyException(String message, String code) {
		super(message);
		this.code = code;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}